import com.tedu.springdemo.day02.Person;
import com.tedu.springdemo.day02.Tom;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test04 {
    @Test
    public void test()
    {
        ApplicationContext ac=new ClassPathXmlApplicationContext("beans8.xml");
        Person p=(Person)ac.getBean("p1");
        System.out.println(p);
        Person p1=(Person) ac.getBean("p1");
        System.out.println(p1);
        ((ClassPathXmlApplicationContext)ac).close();
    }
    @Test
    public void test02()
    {
        ApplicationContext ac=new ClassPathXmlApplicationContext("beans9.xml");
        Tom t=(Tom) ac.getBean("tom");
        System.out.println(t);
        Tom t1=(Tom)ac.getBean("tom1");
        System.out.println(t1);
        ((ClassPathXmlApplicationContext)ac).close();
    }
}
//F8进入下一个断点